package com.eva.dao.system.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.eva.framework.mp.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.util.Date;

@Data
@Accessors(chain = true)
@SuperBuilder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel("系统定时任务日志")
@TableName("`system_job_log`")
public class SystemJobLog extends BaseModel {

    @ApiModelProperty(value = "定时任务ID", example = "1")
    private Integer jobId;

    @ApiModelProperty(value = "任务名称")
    private String jobName;

    @ApiModelProperty(value = "业务时间")
    private Date businessTime;

    @ApiModelProperty(value = "执行开始时间")
    private Date runTimeStart;

    @ApiModelProperty(value = "执行结束时间")
    private Date runTimeEnd;

    @ApiModelProperty(value = "耗时", example = "1")
    private Integer runSpendTime;

    @ApiModelProperty(value = "处理总数", example = "1")
    private Integer handleTotalSize;

    @ApiModelProperty(value = "处理成功数", example = "1")
    private Integer handleSuccessSize;

    @ApiModelProperty(value = "执行任务的服务器IP")
    private String serverIp;

    @ApiModelProperty(value = "状态（0执行失败，1执行成功，2跳过，-1执行中）", example = "1")
    private Byte status;

    @ApiModelProperty(value = "任务执行上下文")
    private String context;

    @ApiModelProperty(value = "触发类型，SYSTEM-系统定时触发，MANUAL-手动触发")
    private String triggerType;

    @ApiModelProperty(value = "备注")
    private String remark;

    @JsonIgnore
    @TableField(exist = false)
    @ApiModelProperty(value="创建人")
    private Integer createdBy;

    @JsonIgnore
    @TableField(exist = false)
    @ApiModelProperty(value="更新人")
    private Integer updatedBy;

    @JsonIgnore
    @TableField(exist = false)
    @ApiModelProperty(value="更新时间")
    private Date updatedAt;

    @JsonIgnore
    @TableField(exist = false)
    @ApiModelProperty(value="是否已删除")
    private Boolean deleted;

}
